﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Simple.Repository.Models
{
    /// <summary>
    /// 每日计划食谱详情
    /// </summary>
    public class PlanDayRecipesDetail : BusinessFullEntityBase<Guid>
    {
        /// <summary>
        /// 每日计划食谱id
        /// </summary>
        public Guid PlanDayRecipesId { get; set; }

        public PlanDayRecipes PlanDayRecipes { get; set; }

        /// <summary>
        /// 食谱id
        /// </summary>
        public Guid RecipesId { get; set; }

        /// <summary>
        /// 食谱
        /// </summary>
        public Recipes Recipes{ get; set; } 
       
        /// <summary>
        /// 类型
        /// </summary>
        public EnumRecipes Type { get; set; }

        public override void ConfigureEntity(ModelBuilder builder)
        {
            builder.Entity<PlanDayRecipesDetail>(entity =>
            {
                entity.HasOne(c => c.PlanDayRecipes).WithMany(c => c.PlanDayRecipesDetails).HasForeignKey(c => c.PlanDayRecipesId);

            });
        }

    }
}
